package com.warm.pump.module.monitor.dao.gen;

import java.util.List;
import java.util.Map;
import java.util.Date;
import java.math.BigDecimal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.frame.gen.util.TypeCast;
import com.warm.pump.frame.gen.exception.ServiceException;
import com.warm.pump.module.monitor.bean.po.gen.LogMailHis;
import com.warm.pump.module.monitor.mapper.gen.LogMailHisMapper;
import com.warm.pump.module.monitor.bean.po.gen.LogMailHisExample;

@Repository
public class LogMailHisDao {
    // 日志对象
    private transient Log log = LogFactory.getLog(this.getClass());
    @Autowired
    private LogMailHisMapper logMailHisMapper;

    // 增加一个后台LogMailHis表

    public boolean insert(LogMailHis logMailHis) {
        try {
            logMailHisMapper.insert(logMailHis);
            log.debug("后台LogMailHis表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis表增加失败");
            throw new ServiceException("后台LogMailHis表增加失败", e);
        }
    }
    // 增加一个后台LogMailHis表Selective

    public boolean insertSelective(LogMailHis logMailHis) {
        try {
            logMailHisMapper.insertSelective(logMailHis);
            log.debug("后台LogMailHis表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis表增加失败");
            throw new ServiceException("后台LogMailHis表增加失败", e);
        }
    }

    // 删除一个后台LogMailHis表

    public boolean deleteByPrimaryKey(Long oid) {
        try {
            logMailHisMapper.deleteByPrimaryKey(oid);
            log.debug("后台LogMailHis表删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis表删除失败");
            throw new ServiceException("后台LogMailHis表删除失败", e);
        }
    }
    // 删除一个后台LogMailHis表byMap

    public boolean deleteByMap(Map logMailHisMap) {
        try {
            logMailHisMapper.deleteByExample(createLogMailHisExample(logMailHisMap, null, null));
            log.debug("后台LogMailHis根据Map删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis根据GroupID删除失败");
            throw new ServiceException("后台LogMailHis根据object删除失败", e);
        }
    }
    // 修改一个后台LogMailHis表

    public boolean updateByPrimaryKey(LogMailHis logMailHis) {
        try {
            logMailHisMapper.updateByPrimaryKey(logMailHis);
            log.debug("后台LogMailHis表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis表修改失败");
            throw new ServiceException("后台LogMailHis表修改失败", e);
        }
    }
    // 修改一个后台LogMailHis表Selective

    public boolean updateByPrimaryKeySelective(LogMailHis logMailHis) {
        try {
            logMailHisMapper.updateByPrimaryKeySelective(logMailHis);
            log.debug("后台LogMailHis表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台LogMailHis表修改失败");
            throw new ServiceException("后台LogMailHis表修改失败", e);
        }
    }
    // 修改一个后台LogMailHis表

    public boolean updateByMap(LogMailHis logMailHis, Map logMailHisMap) {
        try {
            logMailHisMapper.updateByExample(logMailHis, createLogMailHisExample(logMailHisMap, null, null));
            log.debug("后台批量LogMailHis表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量LogMailHis表修改失败");
            throw new ServiceException("后台LogMailHis表批量修改失败", e);
        }
    }
    // 修改一个后台LogMailHis表Selective

    public boolean updateByMapSelective(LogMailHis logMailHis, Map logMailHisMap) {
        try {
            logMailHisMapper.updateByExampleSelective(logMailHis, createLogMailHisExample(logMailHisMap, null, null));
            log.debug("后台批量LogMailHis表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量LogMailHis表修改失败");
            throw new ServiceException("后台LogMailHis表批量修改失败", e);
        }
    }

    // 查询一个后台LogMailHis表

    public LogMailHis selectByPrimaryKey(Long oid) {
        return logMailHisMapper.selectByPrimaryKey(oid);
    }

    // 查询一个后台LogMailHis表-根据map

    public LogMailHis selectByMap(Map logMailHisMap) {
        List<LogMailHis> list = getListByMap(logMailHisMap);
        if (list == null || list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 查询所有后台LogMailHis表

    public List<LogMailHis> getListByMap(Map logMailHisMap) {

        return logMailHisMapper.selectByExample(createLogMailHisExample(logMailHisMap, null, null));
    }

    //统计后台LogMailHis表数量

    public int countTotalByMap(Map logMailHisMap) {

        return logMailHisMapper.countByExample(createLogMailHisExample(logMailHisMap, null, null));
    }


    public List<LogMailHis> getListByMapPage(Map logMailHisMap, int limitStart,
                                             int limitOffset) {

        return logMailHisMapper.selectByExample(createLogMailHisExample(logMailHisMap, limitStart, limitOffset));
    }


    public PageBean getPageBeanByMap(Map logMailHisMap, int pageNo, int pageSize) {
        Integer count = countTotalByMap(logMailHisMap);
        PageBean pageBean = new PageBean();
        pageBean.setCount(count);
        pageBean.setPageNo(pageNo);
        pageBean.setPageSize(pageSize);
        int limitStart = pageBean.getStartNo();
        int limitOffset = pageSize;
        pageBean.setData(logMailHisMapper.selectByExample(createLogMailHisExample(logMailHisMap, limitStart, limitOffset)));
        return pageBean;
    }

    private LogMailHisExample createLogMailHisExample(Map logMailHisMap, Integer limitStart, Integer limitOffset) {
        LogMailHisExample logMailHisEx = new LogMailHisExample();
        LogMailHisExample.Criteria c = logMailHisEx.createCriteria();
        Long oid_null = TypeCast.getLong(logMailHisMap.get("oid_null"));
        Long oid_notNull = TypeCast.getLong(logMailHisMap.get("oid_notNull"));
        Long oid = TypeCast.getLong(logMailHisMap.get("oid"));
        Long oid_not = TypeCast.getLong(logMailHisMap.get("oid_not"));
        Long oid_greater = TypeCast.getLong(logMailHisMap.get("oid_greater"));
        Long oid_greaterEqual = TypeCast.getLong(logMailHisMap.get("oid_greaterEqual"));
        Long oid_less = TypeCast.getLong(logMailHisMap.get("oid_less"));
        Long oid_lessEqual = TypeCast.getLong(logMailHisMap.get("oid_lessEqual"));
        List<Long> oid_in = TypeCast.getLongList(logMailHisMap.get("oid_in"));
        List<Long> oid_notIn = TypeCast.getLongList(logMailHisMap.get("oid_notIn"));
        Long oid_between1 = TypeCast.getLong(logMailHisMap.get("oid_between1"));
        Long oid_between2 = TypeCast.getLong(logMailHisMap.get("oid_between2"));
        Long oid_notBetween1 = TypeCast.getLong(logMailHisMap.get("oid_notBetween1"));
        Long oid_notBetween2 = TypeCast.getLong(logMailHisMap.get("oid_notBetween2"));

        if (oid_null != null) {
            c.andOidIsNull();
        }
        if (oid_notNull != null) {
            c.andOidIsNotNull();
        }
        if (oid != null) {
            c.andOidEqualTo(oid);
        }
        if (oid_not != null) {
            c.andOidNotEqualTo(oid_not);
        }
        if (oid_greater != null) {
            c.andOidGreaterThan(oid_greater);
        }
        if (oid_greaterEqual != null) {
            c.andOidGreaterThanOrEqualTo(oid_greaterEqual);
        }
        if (oid_less != null) {
            c.andOidLessThan(oid_less);
        }
        if (oid_lessEqual != null) {
            c.andOidLessThanOrEqualTo(oid_lessEqual);
        }
        if (oid_in != null) {
            c.andOidIn(oid_in);
        }
        if (oid_notIn != null) {
            c.andOidNotIn(oid_notIn);
        }
        if (oid_between1 != null) {
            c.andOidBetween(oid_between1, oid_between2);
        }
        if (oid_notBetween1 != null) {
            c.andOidNotBetween(oid_notBetween1, oid_notBetween2);
        }
        String emailFrom_null = TypeCast.getString(logMailHisMap.get("emailFrom_null"));
        String emailFrom_notNull = TypeCast.getString(logMailHisMap.get("emailFrom_notNull"));
        String emailFrom = TypeCast.getString(logMailHisMap.get("emailFrom"));
        String emailFrom_not = TypeCast.getString(logMailHisMap.get("emailFrom_not"));
        String emailFrom_greater = TypeCast.getString(logMailHisMap.get("emailFrom_greater"));
        String emailFrom_greaterEqual = TypeCast.getString(logMailHisMap.get("emailFrom_greaterEqual"));
        String emailFrom_less = TypeCast.getString(logMailHisMap.get("emailFrom_less"));
        String emailFrom_lessEqual = TypeCast.getString(logMailHisMap.get("emailFrom_lessEqual"));
        String emailFrom_like = TypeCast.getString(logMailHisMap.get("emailFrom_like"));
        String emailFrom_notLike = TypeCast.getString(logMailHisMap.get("emailFrom_notLike"));
        List<String> emailFrom_in = TypeCast.getStringList(logMailHisMap.get("emailFrom_in"));
        List<String> emailFrom_notIn = TypeCast.getStringList(logMailHisMap.get("emailFrom_notIn"));
        String emailFrom_between1 = TypeCast.getString(logMailHisMap.get("emailFrom_between1"));
        String emailFrom_between2 = TypeCast.getString(logMailHisMap.get("emailFrom_between2"));
        String emailFrom_notBetween1 = TypeCast.getString(logMailHisMap.get("emailFrom_notBetween1"));
        String emailFrom_notBetween2 = TypeCast.getString(logMailHisMap.get("emailFrom_notBetween2"));

        if (emailFrom_null != null) {
            c.andEmailFromIsNull();
        }
        if (emailFrom_notNull != null) {
            c.andEmailFromIsNotNull();
        }
        if (emailFrom != null) {
            c.andEmailFromEqualTo(emailFrom);
        }
        if (emailFrom_not != null) {
            c.andEmailFromNotEqualTo(emailFrom_not);
        }
        if (emailFrom_greater != null) {
            c.andEmailFromGreaterThan(emailFrom_greater);
        }
        if (emailFrom_greaterEqual != null) {
            c.andEmailFromGreaterThanOrEqualTo(emailFrom_greaterEqual);
        }
        if (emailFrom_less != null) {
            c.andEmailFromLessThan(emailFrom_less);
        }
        if (emailFrom_lessEqual != null) {
            c.andEmailFromLessThanOrEqualTo(emailFrom_lessEqual);
        }
        if (emailFrom_like != null) {
            c.andEmailFromLike(emailFrom_like);
        }
        if (emailFrom_notLike != null) {
            c.andEmailFromNotLike(emailFrom_notLike);
        }
        if (emailFrom_in != null) {
            c.andEmailFromIn(emailFrom_in);
        }
        if (emailFrom_notIn != null) {
            c.andEmailFromNotIn(emailFrom_notIn);
        }
        if (emailFrom_between1 != null) {
            c.andEmailFromBetween(emailFrom_between1, emailFrom_between2);
        }
        if (emailFrom_notBetween1 != null) {
            c.andEmailFromNotBetween(emailFrom_notBetween1, emailFrom_notBetween2);
        }
        String emailTo_null = TypeCast.getString(logMailHisMap.get("emailTo_null"));
        String emailTo_notNull = TypeCast.getString(logMailHisMap.get("emailTo_notNull"));
        String emailTo = TypeCast.getString(logMailHisMap.get("emailTo"));
        String emailTo_not = TypeCast.getString(logMailHisMap.get("emailTo_not"));
        String emailTo_greater = TypeCast.getString(logMailHisMap.get("emailTo_greater"));
        String emailTo_greaterEqual = TypeCast.getString(logMailHisMap.get("emailTo_greaterEqual"));
        String emailTo_less = TypeCast.getString(logMailHisMap.get("emailTo_less"));
        String emailTo_lessEqual = TypeCast.getString(logMailHisMap.get("emailTo_lessEqual"));
        String emailTo_like = TypeCast.getString(logMailHisMap.get("emailTo_like"));
        String emailTo_notLike = TypeCast.getString(logMailHisMap.get("emailTo_notLike"));
        List<String> emailTo_in = TypeCast.getStringList(logMailHisMap.get("emailTo_in"));
        List<String> emailTo_notIn = TypeCast.getStringList(logMailHisMap.get("emailTo_notIn"));
        String emailTo_between1 = TypeCast.getString(logMailHisMap.get("emailTo_between1"));
        String emailTo_between2 = TypeCast.getString(logMailHisMap.get("emailTo_between2"));
        String emailTo_notBetween1 = TypeCast.getString(logMailHisMap.get("emailTo_notBetween1"));
        String emailTo_notBetween2 = TypeCast.getString(logMailHisMap.get("emailTo_notBetween2"));

        if (emailTo_null != null) {
            c.andEmailToIsNull();
        }
        if (emailTo_notNull != null) {
            c.andEmailToIsNotNull();
        }
        if (emailTo != null) {
            c.andEmailToEqualTo(emailTo);
        }
        if (emailTo_not != null) {
            c.andEmailToNotEqualTo(emailTo_not);
        }
        if (emailTo_greater != null) {
            c.andEmailToGreaterThan(emailTo_greater);
        }
        if (emailTo_greaterEqual != null) {
            c.andEmailToGreaterThanOrEqualTo(emailTo_greaterEqual);
        }
        if (emailTo_less != null) {
            c.andEmailToLessThan(emailTo_less);
        }
        if (emailTo_lessEqual != null) {
            c.andEmailToLessThanOrEqualTo(emailTo_lessEqual);
        }
        if (emailTo_like != null) {
            c.andEmailToLike(emailTo_like);
        }
        if (emailTo_notLike != null) {
            c.andEmailToNotLike(emailTo_notLike);
        }
        if (emailTo_in != null) {
            c.andEmailToIn(emailTo_in);
        }
        if (emailTo_notIn != null) {
            c.andEmailToNotIn(emailTo_notIn);
        }
        if (emailTo_between1 != null) {
            c.andEmailToBetween(emailTo_between1, emailTo_between2);
        }
        if (emailTo_notBetween1 != null) {
            c.andEmailToNotBetween(emailTo_notBetween1, emailTo_notBetween2);
        }
        String type_null = TypeCast.getString(logMailHisMap.get("type_null"));
        String type_notNull = TypeCast.getString(logMailHisMap.get("type_notNull"));
        String type = TypeCast.getString(logMailHisMap.get("type"));
        String type_not = TypeCast.getString(logMailHisMap.get("type_not"));
        String type_greater = TypeCast.getString(logMailHisMap.get("type_greater"));
        String type_greaterEqual = TypeCast.getString(logMailHisMap.get("type_greaterEqual"));
        String type_less = TypeCast.getString(logMailHisMap.get("type_less"));
        String type_lessEqual = TypeCast.getString(logMailHisMap.get("type_lessEqual"));
        String type_like = TypeCast.getString(logMailHisMap.get("type_like"));
        String type_notLike = TypeCast.getString(logMailHisMap.get("type_notLike"));
        List<String> type_in = TypeCast.getStringList(logMailHisMap.get("type_in"));
        List<String> type_notIn = TypeCast.getStringList(logMailHisMap.get("type_notIn"));
        String type_between1 = TypeCast.getString(logMailHisMap.get("type_between1"));
        String type_between2 = TypeCast.getString(logMailHisMap.get("type_between2"));
        String type_notBetween1 = TypeCast.getString(logMailHisMap.get("type_notBetween1"));
        String type_notBetween2 = TypeCast.getString(logMailHisMap.get("type_notBetween2"));

        if (type_null != null) {
            c.andTypeIsNull();
        }
        if (type_notNull != null) {
            c.andTypeIsNotNull();
        }
        if (type != null) {
            c.andTypeEqualTo(type);
        }
        if (type_not != null) {
            c.andTypeNotEqualTo(type_not);
        }
        if (type_greater != null) {
            c.andTypeGreaterThan(type_greater);
        }
        if (type_greaterEqual != null) {
            c.andTypeGreaterThanOrEqualTo(type_greaterEqual);
        }
        if (type_less != null) {
            c.andTypeLessThan(type_less);
        }
        if (type_lessEqual != null) {
            c.andTypeLessThanOrEqualTo(type_lessEqual);
        }
        if (type_like != null) {
            c.andTypeLike(type_like);
        }
        if (type_notLike != null) {
            c.andTypeNotLike(type_notLike);
        }
        if (type_in != null) {
            c.andTypeIn(type_in);
        }
        if (type_notIn != null) {
            c.andTypeNotIn(type_notIn);
        }
        if (type_between1 != null) {
            c.andTypeBetween(type_between1, type_between2);
        }
        if (type_notBetween1 != null) {
            c.andTypeNotBetween(type_notBetween1, type_notBetween2);
        }
        String subject_null = TypeCast.getString(logMailHisMap.get("subject_null"));
        String subject_notNull = TypeCast.getString(logMailHisMap.get("subject_notNull"));
        String subject = TypeCast.getString(logMailHisMap.get("subject"));
        String subject_not = TypeCast.getString(logMailHisMap.get("subject_not"));
        String subject_greater = TypeCast.getString(logMailHisMap.get("subject_greater"));
        String subject_greaterEqual = TypeCast.getString(logMailHisMap.get("subject_greaterEqual"));
        String subject_less = TypeCast.getString(logMailHisMap.get("subject_less"));
        String subject_lessEqual = TypeCast.getString(logMailHisMap.get("subject_lessEqual"));
        String subject_like = TypeCast.getString(logMailHisMap.get("subject_like"));
        String subject_notLike = TypeCast.getString(logMailHisMap.get("subject_notLike"));
        List<String> subject_in = TypeCast.getStringList(logMailHisMap.get("subject_in"));
        List<String> subject_notIn = TypeCast.getStringList(logMailHisMap.get("subject_notIn"));
        String subject_between1 = TypeCast.getString(logMailHisMap.get("subject_between1"));
        String subject_between2 = TypeCast.getString(logMailHisMap.get("subject_between2"));
        String subject_notBetween1 = TypeCast.getString(logMailHisMap.get("subject_notBetween1"));
        String subject_notBetween2 = TypeCast.getString(logMailHisMap.get("subject_notBetween2"));

        if (subject_null != null) {
            c.andSubjectIsNull();
        }
        if (subject_notNull != null) {
            c.andSubjectIsNotNull();
        }
        if (subject != null) {
            c.andSubjectEqualTo(subject);
        }
        if (subject_not != null) {
            c.andSubjectNotEqualTo(subject_not);
        }
        if (subject_greater != null) {
            c.andSubjectGreaterThan(subject_greater);
        }
        if (subject_greaterEqual != null) {
            c.andSubjectGreaterThanOrEqualTo(subject_greaterEqual);
        }
        if (subject_less != null) {
            c.andSubjectLessThan(subject_less);
        }
        if (subject_lessEqual != null) {
            c.andSubjectLessThanOrEqualTo(subject_lessEqual);
        }
        if (subject_like != null) {
            c.andSubjectLike(subject_like);
        }
        if (subject_notLike != null) {
            c.andSubjectNotLike(subject_notLike);
        }
        if (subject_in != null) {
            c.andSubjectIn(subject_in);
        }
        if (subject_notIn != null) {
            c.andSubjectNotIn(subject_notIn);
        }
        if (subject_between1 != null) {
            c.andSubjectBetween(subject_between1, subject_between2);
        }
        if (subject_notBetween1 != null) {
            c.andSubjectNotBetween(subject_notBetween1, subject_notBetween2);
        }
        String emailText_null = TypeCast.getString(logMailHisMap.get("emailText_null"));
        String emailText_notNull = TypeCast.getString(logMailHisMap.get("emailText_notNull"));
        String emailText = TypeCast.getString(logMailHisMap.get("emailText"));
        String emailText_not = TypeCast.getString(logMailHisMap.get("emailText_not"));
        String emailText_greater = TypeCast.getString(logMailHisMap.get("emailText_greater"));
        String emailText_greaterEqual = TypeCast.getString(logMailHisMap.get("emailText_greaterEqual"));
        String emailText_less = TypeCast.getString(logMailHisMap.get("emailText_less"));
        String emailText_lessEqual = TypeCast.getString(logMailHisMap.get("emailText_lessEqual"));
        String emailText_like = TypeCast.getString(logMailHisMap.get("emailText_like"));
        String emailText_notLike = TypeCast.getString(logMailHisMap.get("emailText_notLike"));
        List<String> emailText_in = TypeCast.getStringList(logMailHisMap.get("emailText_in"));
        List<String> emailText_notIn = TypeCast.getStringList(logMailHisMap.get("emailText_notIn"));
        String emailText_between1 = TypeCast.getString(logMailHisMap.get("emailText_between1"));
        String emailText_between2 = TypeCast.getString(logMailHisMap.get("emailText_between2"));
        String emailText_notBetween1 = TypeCast.getString(logMailHisMap.get("emailText_notBetween1"));
        String emailText_notBetween2 = TypeCast.getString(logMailHisMap.get("emailText_notBetween2"));

        if (emailText_null != null) {
            c.andEmailTextIsNull();
        }
        if (emailText_notNull != null) {
            c.andEmailTextIsNotNull();
        }
        if (emailText != null) {
            c.andEmailTextEqualTo(emailText);
        }
        if (emailText_not != null) {
            c.andEmailTextNotEqualTo(emailText_not);
        }
        if (emailText_greater != null) {
            c.andEmailTextGreaterThan(emailText_greater);
        }
        if (emailText_greaterEqual != null) {
            c.andEmailTextGreaterThanOrEqualTo(emailText_greaterEqual);
        }
        if (emailText_less != null) {
            c.andEmailTextLessThan(emailText_less);
        }
        if (emailText_lessEqual != null) {
            c.andEmailTextLessThanOrEqualTo(emailText_lessEqual);
        }
        if (emailText_like != null) {
            c.andEmailTextLike(emailText_like);
        }
        if (emailText_notLike != null) {
            c.andEmailTextNotLike(emailText_notLike);
        }
        if (emailText_in != null) {
            c.andEmailTextIn(emailText_in);
        }
        if (emailText_notIn != null) {
            c.andEmailTextNotIn(emailText_notIn);
        }
        if (emailText_between1 != null) {
            c.andEmailTextBetween(emailText_between1, emailText_between2);
        }
        if (emailText_notBetween1 != null) {
            c.andEmailTextNotBetween(emailText_notBetween1, emailText_notBetween2);
        }
        Date sendTime_null = TypeCast.getDate(logMailHisMap.get("sendTime_null"));
        Date sendTime_notNull = TypeCast.getDate(logMailHisMap.get("sendTime_notNull"));
        Date sendTime = TypeCast.getDate(logMailHisMap.get("sendTime"));
        Date sendTime_not = TypeCast.getDate(logMailHisMap.get("sendTime_not"));
        Date sendTime_greater = TypeCast.getDate(logMailHisMap.get("sendTime_greater"));
        Date sendTime_greaterEqual = TypeCast.getDate(logMailHisMap.get("sendTime_greaterEqual"));
        Date sendTime_less = TypeCast.getDate(logMailHisMap.get("sendTime_less"));
        Date sendTime_lessEqual = TypeCast.getDate(logMailHisMap.get("sendTime_lessEqual"));
        List<Date> sendTime_in = TypeCast.getDateList(logMailHisMap.get("sendTime_in"));
        List<Date> sendTime_notIn = TypeCast.getDateList(logMailHisMap.get("sendTime_notIn"));
        Date sendTime_between1 = TypeCast.getDate(logMailHisMap.get("sendTime_between1"));
        Date sendTime_between2 = TypeCast.getDate(logMailHisMap.get("sendTime_between2"));
        Date sendTime_notBetween1 = TypeCast.getDate(logMailHisMap.get("sendTime_notBetween1"));
        Date sendTime_notBetween2 = TypeCast.getDate(logMailHisMap.get("sendTime_notBetween2"));

        if (sendTime_null != null) {
            c.andSendTimeIsNull();
        }
        if (sendTime_notNull != null) {
            c.andSendTimeIsNotNull();
        }
        if (sendTime != null) {
            c.andSendTimeEqualTo(sendTime);
        }
        if (sendTime_not != null) {
            c.andSendTimeNotEqualTo(sendTime_not);
        }
        if (sendTime_greater != null) {
            c.andSendTimeGreaterThan(sendTime_greater);
        }
        if (sendTime_greaterEqual != null) {
            c.andSendTimeGreaterThanOrEqualTo(sendTime_greaterEqual);
        }
        if (sendTime_less != null) {
            c.andSendTimeLessThan(sendTime_less);
        }
        if (sendTime_lessEqual != null) {
            c.andSendTimeLessThanOrEqualTo(sendTime_lessEqual);
        }
        if (sendTime_in != null) {
            c.andSendTimeIn(sendTime_in);
        }
        if (sendTime_notIn != null) {
            c.andSendTimeNotIn(sendTime_notIn);
        }
        if (sendTime_between1 != null) {
            c.andSendTimeBetween(sendTime_between1, sendTime_between2);
        }
        if (sendTime_notBetween1 != null) {
            c.andSendTimeNotBetween(sendTime_notBetween1, sendTime_notBetween2);
        }
        if (logMailHisMap.get("orderBy") != null) {
            logMailHisEx.setOrderByClause((String) logMailHisMap.get("orderBy"));
        }
        if (limitStart != null && limitOffset != null) {
            logMailHisEx.setLimitStart(limitStart);
            logMailHisEx.setLimitOffset(limitOffset);
        }

        return logMailHisEx;
    }
}
